using System;
using System.Collections.Generic;
using System.Text;

namespace PowerStructure
{
    public static class Extensions
    {
        public static void Cast<Derive, Base>(this List<Base> source) where Derive : Base
        {
            foreach (var item in source)
                Console.WriteLine(item);
        }
        public static void Write<T>(this IEnumerable<T> source)
        {
            foreach (var item in source)
                Console.WriteLine(item);
        }
        public static void Do<T>(this IEnumerable<T> list, Action<T> action)
        {
            foreach(T item in list)
                action(item);
        }
        
        public static string Camelize(this string str)
        {
            string ret;
            if(str.Length > 2)
              ret = str.Substring(0,1).ToUpper() + str.Substring(1,  str.Length -1).ToLower();                
            else
               ret = str;

            return ret;
        }
    }    
}
